#ifndef __USART_H__
#define __USART_H__

#include "stdio.h"
#include "gd32f1x0.h"

#define UART1_TX		GPIO_PIN_9
#define UART1_RX		GPIO_PIN_10
#define UART1_IO		GPIOA

//#define UART1_TX		GPIO_PIN_6
//#define UART1_RX		GPIO_PIN_7
//#define UART1_IO		GPIOB


#define UART2_TX		GPIO_PIN_2
#define UART2_RX		GPIO_PIN_3
#define UART2_IO		GPIOA

//extern volatile u8 Rec_OLED_GRAM[64][6];
extern u8 Rec_OLED_GRAM[64][6];
extern volatile u8 Rec_JUST_DATA[20];


extern volatile u8 Rec_end;
extern volatile u16 Rec_cnt;
extern volatile u8 Rec_ON_OFF;
extern volatile u8 Rec_ST;
extern volatile u8 Rec_Cmd;
extern uint16_t data_received;
extern uint16_t dma_start_pos;
extern u8 receive_flag;

void Send_CMD_DATA(void);
void USART1_Init(void);
void gd32_uart1_init(void);
void Usart1_Send_Byte(unsigned char tx_data);
void process_received_data(uint16_t start_pos, uint16_t data_length);



#endif

